<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
<%@include file="/header.jsp" %>
	<link rel="stylesheet" href="${base}static/commoncss/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="${base}static/commoncss/main.css" media="all" />
<title>后台管理</title>
<style type="text/css">
  .active {background-color:#1AA094 !important;;}
 .active a{color:#fff !important;;}
</style>
<script type="text/javascript">
   var menuTree={};
   function getSubMenu(menuId,index){
	   $("[id^='menu_']").removeClass("active");
	   $("#"+menuId).addClass("active");
	   subMenus(index); 
   }
   
   function logout(){
	   window.location.href="${base}system/sysLogin/logout";
   }
   $(function(){
	   //加载子菜单
	  var subId='${subMenu.id}';
	  subMenus(subId);
   });
   var menuUrl="${base}system/sysResource/menuTree?parentId=";
   function subMenus(subId){
	   //获取子菜单
	   $.ajax({url:menuUrl+subId,type:'post',dataType:'json',
			success:function(data){
				$(".navBar").html(navBar(data)).height($(window).height()-230);
		},error:function(){
			//子菜单加载失败
		}});
   } 
</script>
</head>
<body class="main_body">
	<div class="layui-layout layui-layout-admin">
		<!-- 顶部 -->
		<div class="layui-header header">
			<div class="layui-main">
				<a href="#" class="logo">后台管理</a>
			    <!-- 顶部右侧菜单 -->
		 <ul class="layui-nav top_menu">
		             <c:forEach items="${menuList}" var="menu" varStatus="status">
		                <li class="layui-nav-item <c:if test="${subMenu.id eq menu.id}">active</c:if>"  id="menu_${menu.id}" >
		                <%-- <a href="javascript:getSubMenu('menu_${menu.id}',${menu.id});"><i class="layui-icon" >${menu.icon}</i> ${menu.name}</a> --%>
		                <a href="${base}system/sysLogin/main?menuId=${menu.id}" target="_self"><i class="layui-icon" >${menu.icon}</i> ${menu.name}</a> 
		                </li>
		             </c:forEach>
					 <li class="layui-nav-item" >
						<a href="javascript:;">
							<img src="${base}images/face.jpg" class="layui-circle" width="35" height="35">
							<cite>${user.userName}</cite>
						</a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:;" data-url="page/user/userInfo.html"><i class="iconfont icon-zhanghu" data-icon="icon-zhanghu"></i><cite>个人资料</cite></a></dd>
							<dd><a href="javascript:;" data-url="page/user/changePwd.html"><i class="iconfont icon-shezhi1" data-icon="icon-shezhi1"></i><cite>修改密码</cite></a></dd>
							<dd><a href="javascript:logout();"><i class="iconfont icon-loginout"></i><cite>退出</cite></a></dd>
						</dl>
					</li>
				</ul>
			</div>
		</div>
		<!-- 左侧导航 -->
		<div class="layui-side layui-bg-black">
			<div class="navBar layui-side-scroll"></div>
		</div>
		<!-- 右侧内容 -->
		<div class="layui-body layui-form">
			<div class="layui-tab marg0" lay-filter="bodyTab">
				<ul class="layui-tab-title top_tab">
					<li class="layui-this" lay-id=""><i class="iconfont icon-computer"></i> <cite>后台首页</cite></li>
				</ul>
				<div class="layui-tab-content clildFrame">
					<div class="layui-tab-item layui-show">
						<iframe src="page/main.html"></iframe>
					</div>
				</div>
			</div>
		</div>
		<!-- 底部 -->
		<div class="layui-footer footer">
			<p>copyright @2017 </p>
		</div>
	</div>
	<script type="text/javascript" src="${base}static/commonjs/leftNav.js"></script>
	<script type="text/javascript" src="${base}static/commonjs/index.js"></script>
</body>
</html>